// import Vue from 'vue'
import Router from 'vue-router'

// Vue.use(Router)

// const Test = () => import('../components/common/test')

//救援
const Task = () => import('../components/Rescue/task/Index');
const Air = () => import('../components/air')
const Mapp = () => import('../components/common/mapp/mapp')
const Personal = () => import('../components/Rescue/personal/')
const TaskDetails = () => import('../components/Rescue/task/orders/children/Details')
const Player = () => import('../components/Rescue/personal/children/Player')

//公共组件
const Setting = () => import('../components/common/settiog')
const LoginPass = () => import('../components/common/loginPass/loginPass')

const Payment = () => import('../components/common/paymentPass/payment')
const verification = () => import('../components/common/paymentPass/modify')
const forget = () => import('../components/common/paymentPass/forget')

//user
const userHome = () => import('../components/user/home/Home')				//首页
const article = () => import('../components/user/home/children/article')	//小贴士详情
const userRescue = () => import('../components/user/home/children/rescue/rescue')

const personal = () => import('../components/user/personal/index')			//个人中心
const remind = () => import('../components/user/personal/children/remind')

const userProgress = () => import('../components/Rescue/task/orders/children/Progress')

//基本信息
const Basic = () => import('../components/user/personal/children/basic/basic')
const Verified = () => import('../components/user/personal/children/basic/verified')

//保险
const InsuranceList = () => import('../components/user/home/children/insurance/InsuranceList')
const InsuranceDetails = () => import('../components/user/home/children/insurance/InsuranceDetails')

//用户个人中心
const money = () => import('../components/user/personal/children/money')	//钱包

//登录注册
const login = () => import('../components/login/login')
const newUser = () => import('../components/login/newUser/phone');
const ForgetPass = () => import('../components/login/ForgetPass')

//
const timeShare = () => import('../components/stock/timeShare') //时分
const kLine = () => import('../components/stock/kLine') //日K

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/rescue'
	},
	{
		path:'/stock',
		component:Air,
		children:[
			{
				path:'timeShare',
				component:timeShare,
				meta:{ title:'分时' },
			},
			{
				path:'kline',
				component:kLine,
				meta:{ title:'日K' },
			},
		]
	},
	{
		path:'/setting',
		component:Setting,
		meta:{ title:'设置' },
		children:[
			{
				path:'loginPass',
				component:LoginPass,
				meta:{ title:'修改支付密码' },
			},
			{
				path:'payment',
				component:Payment,
				meta:{ title:'支付密码' },
				children:[
					{
						path:'verification',
						component:verification,
						meta:{ title:'修改支付密码' }
					},{
						path:'forget',
						component:forget,
						meta:{ title: '忘记支付密码' }
					}
				]
			}
		]
	},
	{
		path:'/user',
		component:Air,
		children:[
			{
				path:'',
				redirect:'/user/home'
			},
			{
				path:'login',
				component: login,
				meta:{ title:'登录' }
			},
            {
                path:'forgetPass',
				component:ForgetPass,
				meta:{ title:'忘记密码' }
            },
			{
				path:'newUser/:status?/:phone?/:code?',
				component:newUser,
				meta:{ title:'新用户注册' }
			},
			{
				path:'personal',
				component:personal,
				meta:{ title:'个人中心' },
				children:[
					{
						path:'money',
						component:money,
						meta:{ title:'钱包' }
					},
					{
						path:'basic',
						component:Basic,
						meta:{ title:'基本信息' },
						children:[
						]
					},
					{
						path:'verified',
						component:Verified,
						meta:{title:'实名认证'}
					},
					{
						path:'remind',
						component:remind,
					}
				]
			},
			{
				path:'home/:enter?',
				component:userHome,
				meta:{ title:'天佑' },
				children:[
					{
						path:'insuranceList',
						component:InsuranceList,
						meta:{ title:'保险' },
						children:[{
							path:'InsuranceDetails/:id?',
							component:InsuranceDetails,
							meta:{ title:'保险详情' }
						}]
					},
					{
						path:'userRescue',
						component: userRescue,
						meta:{ title:'救援卡' }
					},
					{
						path:'article/:id',
						component:article,
						meta:{ title:'小常识' }
					}
				]
			}
		]
	},
	{
		path:'/rescue',
		component:Air,
		children:[
			{
				path:'',
				redirect:'/rescue/task'
			},
			{
				path:'task',
				component:Task,
				meta:{ title:'任务中心' },
				children:[
					{
						path:'Details',
						component: TaskDetails,
						meta:{ title:'任务详情' },
					},
					{
						path:'progress',
						component: userProgress,
						meta:{ title : '救援进展' }
					}
				]
			},
			{
				path:'map',
				component: Mapp,
				meta:{ title:'导航' },
			}
		]
	},
	{
		path:'/personal',
        component:Personal,
        meta:{ title: '设置' },
        children:[
            {
                path:'player',
                component: Player,
                meta:{ title: '队员列表' }
            }
        ]
	},
	{
		path:'/test',
		component: Task
	}
  ]
})


